<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
  <!ENTITY dc "http://purl.org/dc/elements/1.1/">
  <!ENTITY dcterms "http://purl.org/dc/terms/">
  <!ENTITY foaf "http://xmlns.com/foaf/0.1/">
  <!ENTITY a "http://xmlns.heustics.org/schema/myelin/0.1/">
  <!ENTITY iso "http://xmlns.heustics.org/schema/iso/0.1/">
  <!ENTITY m "http://xmlns.heustics.org/ontology/myelin/0.1/">
]>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:a="http://xmlns.heustics.org/schema/myelin/0.1/" 
  xmlns:l="http://xmlns.heustics.org/schema/i18n/0.1/"
  exclude-result-prefixes="xsl a l"
>    
  <xsl:template match="a:language|a:region" mode="a:input-show" name="a:language-select-input">  
    <xsl:param name="label"/>
    <xsl:param name="hint"/>
    <xsl:param name="ln" select="local-name()"/>
    <xsl:param name="selected" select="string(@selected)"/>
    <div class='input text {$ln}'>  
      <div class="key">
        <div>
          <xsl:call-template name="a:label-class-attr"/>
          <span>
            <xsl:value-of select="$label"/>
          </span>
          <div class="spacer"/>
        </div>        
        <div class='hint'>
          <xsl:call-template name="a:input-hints">
            <xsl:with-param name="hint" select="$hint"/>
          </xsl:call-template>
          <div class="spacer"/>
        </div>
        <div class="spacer"/>
      </div>      
      <div class='value'>        
        <select name="{$ln}">                    
          <xsl:for-each select="a:get-l10n(concat('&iso;',$ln))/*[@name='names']/*">
            <option value='{@key}'>
              <xsl:if test='$selected = @key'>
                <xsl:attribute name='selected'>selected</xsl:attribute>
              </xsl:if>      
              <xsl:value-of select='.'/>
            </option>
          </xsl:for-each>
        </select>     
        <div class="spacer"/>   
      </div>
      <div class='spacer'/>
    </div>
  </xsl:template>
  
</xsl:stylesheet>

